Skip to main content
PATCH
/
functions
/
{name}
[beta] Update a Function.
curl --request PATCH \
  --url https://api.samsara.com/functions/{name} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "lastUpdateTimestampMs": 1609459200000,
  "config": {
    "handler": "index.handler",
    "isScheduleEnabled": false,
    "params": {
      "region": "us-west",
      "threshold": "100"
    },
    "secrets": {
      "API_KEY": "my-secret-value"
    }
  },
  "description": "Processes incoming telemetry data."
}
'
{
  "data": {
    "lastUpdateTimestampMs": 1609459200000,
    "name": "my-function",
    "updatedAtTime": "2021-01-01T00:00:00Z",
    "uploadPutUrl": "https://example.com/upload?token=..."
  }
}

Documentation Index

Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

name
string
required

The name of the Function to update.

Body

application/json

Request body for updating a Function.

lastUpdateTimestampMs
integer<int64>
required

Timestamp of the last known update to this Function, obtained from a create or get response. Required to prevent conflicting updates.

Example:

1609459200000

config
object

Configuration fields to update on the Function. All fields are optional; only provided fields are updated.

description
string

A description of the Function.

Example:

"Processes incoming telemetry data."

Response

OK response.

data
object
required

Details of an updated Function, including a URL for uploading a new code package. After uploading, call the deploy endpoint for the changes to be applied.